﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Products.Domain.SubProducts;
using Products.Dto.Product;

namespace Products.Domain.Products
{
    public interface IProduceFactory
    {
        Produce CreateNewProduce(CreateNewProductParametersDto parameters);
    }

    public class ProduceFactory : IProduceFactory
    {


        public Produce CreateNewProduce(CreateNewProductParametersDto parameters)
        {
            IEnumerable<SubProduct> exampleListOfSubProducts = new
                List<SubProduct>() {new SubProduct {Id = Guid.NewGuid(), Name = "Test1"}};
            Guid id = Guid.NewGuid();
            var newProduce = new Produce(exampleListOfSubProducts, id,
                                         parameters.ProductName, parameters.Description,
                                         parameters.Price, parameters.AdditionalDescription
                );
            return newProduce;
        }
    }
}
